home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_bab_tablet.cog < prev    next >
Text File  |  1999-11-15  |  27KB  |  969 lines

  1. # Jones 3D Cog Script
  2. #
  3. # BAB_Tablet.cog
  4. #
  5. # [SXC & revised by HB]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. # ==============================================================================
  9.  
  10. symbols
  11.  
  12. # MESSAGES *********************************************************************
  13.  
  14. message        startup
  15. message        activate
  16. message        crossed
  17. message     blocked
  18.  
  19. # KEYFRAMES ********************************************************************
  20.  
  21. keyframe    in_armsCrossed=0in_stand2.key            local
  22. keyframe    in_crossArms=0in_stand1_bd_2.key        local
  23. keyframe    in_stand4=0in_stand4.key                local
  24. keyframe    in_SideToHips=0in_stand1_bd_4.key        local
  25. keyframe    in_nod=0in_nod_4_4.key                    local
  26. keyframe    in_HipsToSide=0in_stand4_bd_1.key        local
  27. keyframe    in_act_med=in_activate_medium.key        local
  28. keyframe    in_act_high=in_reach_high.key            local
  29. keyframe    in_figithat=0in_figithat_4_4.key        local
  30. keyframe    in_scratch=0in_scrtch_1_1.key            local
  31. keyframe    in_reading=0in_readtablet_4_4.key        local
  32. keyframe    in_ltarmup=0in_leftarm_1_1.key            local
  33. keyframe    in_rtarmup=0in_armsout_1_1.key            local
  34. keyframe    in_bothup=0in_armsup_1_1.key            local
  35. keyframe    in_lookup=0in_stand8.key                local
  36. keyframe    in_lookdn=0in_stand5.key                local
  37.  
  38. keyframe    elev_key=bab_elgears.key                local
  39.  
  40. # SOUNDS ***********************************************************************
  41.  
  42. # no budge lines...
  43. sound        in_cantopen=Inxj096.wav                local # can't open it
  44. sound        in_wontopen=Inxj097.wav                local # some reason door won't open
  45. sound        in_wontbudge=Inxj098.wav            local # won't budge
  46. sound        in_whynotopen=Inxj100.wav            local # looks like door...why not open
  47. sound        in_dontknowhow=Inxj101.wav            local # must be way, don't know how
  48.  
  49. # curious lines...
  50. sound        in_interesting=Inxj001a.wav            local # looks interesting
  51. sound        in_whathere=Inxj005.wav                local # what have we here
  52. sound        in_somethinghere=Inxj141.wav        local # something here
  53. sound        in_lookwell=Inxj232.wav                local # well well, look this
  54. sound        in_important=Inxj233.wav            local # might be important
  55. sound        in_contraption=Inxj118.wav            local # contraption...how work
  56.  
  57. # gadget lines...
  58. sound        in_machinery=Inxj115.wav            local # worth phd
  59. sound        in_shafts=Inxj116.wav                local # gears...amazing
  60. sound        in_gadget=Inxj117.wav                local # gadget...how work
  61.  
  62. # wrong item lines...
  63. sound        in_wontwork=Inxj058.wav                local # that won't work
  64. sound        in_whoops=Inxj087.wav                local # Whoops
  65. sound        in_nope=Inxj088.wav                    local # Nope
  66. sound        in_notright=Inxj060.wav                local # I don't think...right answer
  67. sound        in_badidea=Inxj061.wav                local # not sure good idea
  68.  
  69. sound       in_giftpurpose=bb06j02.wav            local # sophia's gift has purpose
  70.  
  71. sound       in_line_otis=bb05j01.wav            local # Otis not invent elevator
  72.  
  73. sound       tripsound
  74. sound       placeItSound
  75.  
  76. sound       in_line_j01=bb09j01.wav                            local
  77. sound       in_line_j02=bb09j02.wav                            local
  78. sound       in_line_j03=bb09j03.wav                            local # 3.8s
  79. sound       in_line_j04=bb09j04.wav                            local
  80. sound       in_line_j05=bb09j05.wav                            local
  81. sound       in_line_j06=bb09j06.wav                            local
  82. sound       in_line_j07=bb09j07.wav                            local
  83. sound       in_traveladvice=bb09j08.wav                        local
  84. sound        in_getgoing=Bb09j09.wav                            local
  85.  
  86. sound       elev_gears_stop=nub_elev_stopecho_c.wav         local
  87. sound       elev_gears_moving=nub_weight_move_c.wav         local
  88. sound       sophia_gear_place=nub_anubisarm_place_c.wav     local
  89. sound       rounddoor_spin=bab_door_metal_slide_c.wav       local
  90. sound       rounddoor_stop=bab_door_metal_stop.wav          local
  91.  
  92. sound        elev_moving=teo_spike_block_c.wav                local
  93. sound        elev_stop=gen_stone_stop_c.wav                    local
  94.  
  95. sound       doorhappy=mus_bab_tablettrans.wav               local
  96. sound       platformwav0=mus_gen_awesome1.wav               local
  97. sound       platformwav1=mus_gen_awesome2.wav               local
  98.  
  99. sound        in_nowork0=Inxj089.wav                            local # That didn't work-->in_sayline[11]
  100. sound        in_nowork1=Inxj090.wav                            local # ...something wrong.
  101. sound        in_nowork2=Inxj092.wav                            local # Hmm...didn't quite work.
  102. sound        in_nowork3=Inxj060.wav                            local # I don't think...right answer
  103. sound        in_nowork4=Inxj095.wav                            local # Whoops.
  104. sound        in_nowork5=Inxj094.wav                            local # Nope.
  105. sound        in_nowork6=Inxj091.wav                            local # Of course that didn't work.
  106.  
  107. # THINGS ***********************************************************************
  108.  
  109. thing       player                          local
  110. thing       actorindy
  111. thing       actorindy2
  112. thing        tabindy                            local # create on fly
  113. thing        elevindy                              # used on elevator
  114.  
  115. thing       platform
  116. thing       lowerButton
  117. thing       upperButton
  118. thing       tabletAPos
  119. thing       tabletBPos
  120. thing       tabletCPos
  121. thing       roundmapdoor
  122. thing       hiddendoor
  123. thing       block
  124.  
  125. # Cameras **********************
  126.  
  127. thing       tablet_cam0                        nolink
  128. thing       tablet_cam1                        nolink
  129. thing       tablet_cam2                        nolink
  130. thing       elev_cam0                        nolink
  131. thing        door_cam0                        nolink
  132. thing        cam1spot                        nolink
  133. thing        cam1look                        nolink
  134. thing        tabcam                            local # create on fly
  135.  
  136. # Targets **********************
  137.  
  138. thing       platform_tgt0                    nolink # linked to platform_tgt0
  139. thing       tab_tgt0                        nolink
  140. thing       tab_tgt1                        nolink
  141. thing       tab_tgt2                        nolink # also linked to platform_tgt0 (?!)
  142. thing       tab_tgt3                        nolink
  143. thing       gear_targ0                        nolink
  144. thing        gear_targ1                        nolink
  145.  
  146. thing        tab_mk_1                        nolink # used on elevator
  147. thing        tab_mk_2                        nolink # used on elevator
  148.  
  149. thing        tab_door_mk                        nolink
  150.  
  151. # Misc Things ******************
  152.  
  153. thing       gear_assembly
  154. thing       elev_gears
  155.  
  156. # WORLD & ENGINE REFS **********************************************************
  157.  
  158. template    babTabletA
  159. template    babTabletB
  160. template    babTabletC
  161. template    elevpart=elgears                local
  162. template    pushblock=2x2babcrate            local
  163. template    tpl_Indy=indy_sh_actor            local
  164. template    tpl_ghost=ghost                    local
  165.  
  166. cog            hintcog
  167.  
  168. sector        camsector                        local # var
  169.  
  170. surface     blocksurf                        mask=0x080
  171. surface     blockon_surf                    mask=0x080
  172. surface     blockoff_surf                    mask=0x080
  173. surface     tabletsocket
  174.  
  175. # VARS *************************************************************************
  176.  
  177. vector        v_aimcam                        local
  178. vector        v_campos                        local
  179. vector        v_lookpos                        local
  180.  
  181. flex        setcamstuff                        local # label
  182. flex        camfinish                        local # label
  183. flex        tabtalkfinish                    local # label
  184. flex        budgelines                        local # label
  185. flex        curiouslines                    local # label
  186. flex        gadgetlines                        local # label
  187. flex        wrongitemlines                    local # label
  188. flex        viewangle                        local
  189.  
  190. int         pulledcheck=0                   local
  191. int         tabletflag=0                    local
  192. int            gearflag=0                        local
  193. int         turnrkeyindex=55                local
  194. int         tabcheck=0                      local
  195. int         allparts=0                      local
  196. int         elev_track                      local
  197. int         gear_track                      local
  198. int         in_track0                       local
  199. int         in_track1                       local
  200. int            in_track2                        local
  201. int         curblock                        local
  202. int         door_chan                       local
  203. int         blockchek=0                     local
  204. int         door_stop                       local
  205. int            cursound                        local
  206. int         blockon=1                       local
  207. int         doormusic                       local
  208. int            tabindyexists=0                    local
  209. int            tabcamexists=0                    local
  210. int            active=0                        local
  211. int            sender                            local
  212. int            source                            local
  213. int            curitem                            local
  214. int            b_oldline=50                    local
  215. int            b_newline=50                    local
  216. int            c_oldline=50                    local
  217. int            c_newline=50                    local
  218. int            g_oldline=50                    local
  219. int            g_newline=50                    local
  220. int            w_oldline=50                    local
  221. int            w_newline=50                    local
  222. int            saidbudge=0                        local    
  223. int            saidgadget=0                    local    
  224. int            saidgear=0                        local
  225. int            saidtablet=0                    local
  226. int            wronggear=0                        local
  227. int            wrongtablet=0                    local
  228. int         lastrand=-1                     local
  229. int         currand=0                       local
  230.  
  231. end
  232.  
  233. # ..............................................................................
  234.  
  235. code
  236.  
  237. startup:
  238.  
  239.     SetThingFlags(actorindy, 0x80000);
  240.     SetThingFlags(actorindy2, 0x80000);
  241.     SetThingFlags(elev_gears, 0x80000);
  242.     player = GetLocalPlayerThing();
  243.     MoveToFrame(lowerButton, 1, 1);
  244.     MoveToFrame(upperButton, 1, 1);
  245.  
  246. return;
  247.  
  248. # ..............................................................................
  249.  
  250. crossed:
  251.     
  252.     sender = GetSenderRef();
  253.     source = GetSourceRef();
  254.     
  255.     if ((sender == blockon_surf) && (source == block))
  256.     {
  257.         blockon = 1;
  258.     }
  259.     
  260.     if ((sender == blockoff_surf) && (source == block))
  261.     {
  262.         blockon = 0;
  263.     }
  264.  
  265.     if ((sender == blocksurf) && (pulledcheck == 0) && (source == block))
  266.     {
  267.         # Block on elevator causes it to descend...
  268.         pulledcheck=1;
  269.         
  270.         # Wait for block to get pulled all the way onto platform...
  271.         SetActorFlags(player, 0x200000);
  272.         Sleep(3);
  273.  
  274.         # Block is in place...
  275.         PlaySoundThing(tripsound, platform, 1, 3, 10, 0);
  276.             
  277.         MakeMeStop();
  278.         StartCutscene(1);
  279.         TeleportThing(elevindy, player);
  280.         SetThingFlags(player, 0x80000);
  281.         ClearThingFlags(elevindy, 0x80000);
  282.         CopyPlayerHolsters(player, elevindy);
  283.         SetExtCamOffset('0.15 -0.12 0.095');
  284.         AttachThingToThing(block, platform);
  285.         AttachThingToThingEx(tab_mk_1, platform, 0x0C);
  286.         AttachThingToThingEx(tab_mk_2, platform, 0x0C);
  287.         Sleep(1.0);
  288.         
  289.         # Lower elevator...
  290.         MoveToFrame(platform, 1, 2.5); # was 3.0
  291.  
  292.         # TO DO: play elevator looping sound...
  293.  
  294.         # Music...?
  295.         # PlaySoundLocal(platformwav0, 1, 0, 0, 0);
  296.  
  297.         # Reposition Indy...
  298.         AISetMoveSpeed(elevindy, 0.8);
  299.         AIEnableBodyTracking(elevindy, tab_mk_2);
  300.         AISetMoveThing(elevindy, tab_mk_1, 0);
  301.         Sleep(0.5);
  302.         
  303.         # Indy: "I guess Mr. Otis didn't invent...good digger would have found this..."
  304.         cursound = PlayVoice(elevindy, in_line_otis, 1.0, 0);
  305.         Sleep(0.5);
  306.         in_track0 = PlayKey(elevindy, in_armscrossed, 2, 0x10, 0);
  307.         PlayKey(elevindy, in_crossarms, 4, 0x12, 0);
  308.         Sleep(3.0);
  309.         StopKey(elevindy, in_track0, 0.5);
  310.         Sleep(1.0);
  311.         PlayKey(elevindy, in_ltarmup, 4, 0x12, 0);
  312.          WaitForSound(cursound);
  313.         WaitForStop(platform);
  314.         PlaySoundLocal(elev_stop, 1, 0, 0x0, 0);
  315.         AIDisableBodyTracking(elevindy);
  316.         Sleep(1.0);
  317.  
  318.         # Clean up & restore control...
  319.         v_campos =
  320.         VectorAdd(VectorTransformToOrient(elevindy, '-0.1 -0.25 0.1'), GetThingPos(elevindy));
  321.         SetCameraPosition(1, v_campos);
  322.         TeleportThing(player, elevindy);
  323.         SetThingFlags(elevindy, 0x80000);
  324.         ClearThingFlags(player, 0x80000);
  325.  
  326.         EndCutscene();
  327.         DestroyThing(elevindy);
  328.         DestroyThing(tab_mk_1);
  329.         DestroyThing(tab_mk_2);
  330.         ClearActorFlags(player, 0x200000);
  331.         RestoreExtCam();
  332.     }        
  333.             
  334. return;
  335.  
  336. # ..............................................................................
  337.  
  338. activate:
  339.  
  340.     if (active != 0)
  341.     {
  342.         return;
  343.     }
  344.  
  345.     sender = GetSenderRef();
  346.     curitem = GetCurItem(player);
  347.  
  348.     active = 1;
  349.  
  350.     if (sender == roundmapdoor)
  351.     {
  352.         Call setcamstuff;
  353.         if (tabletflag == 0)
  354.         {
  355.             Call budgelines;
  356.         }
  357.         else
  358.         {
  359.             PlayVoice(tabindy, in_getgoing, 1.0, 1);
  360.         }        
  361.         Call camfinish;
  362.     }
  363.  
  364.     if ((sender == gear_assembly) && (curitem == 0))
  365.     {    
  366.         Call setcamstuff;
  367.         if (gearflag == 0)
  368.         {
  369.             Call curiouslines;
  370.         }
  371.         else
  372.         {
  373.             Call gadgetlines;
  374.         }
  375.         Call camfinish;
  376.     }
  377.  
  378.     if ((sender == gear_assembly) && (curitem != 0) && (curitem != 82))
  379.     {
  380.         SetActorFlags(player, 0x200000);
  381.         StartCutscene(0);
  382.         Call wrongitemlines;
  383.         EndCutscene();
  384.         ClearActorFlags(player, 0x200000);
  385.     }
  386.     
  387.     if ((sender == gear_assembly) && (curitem == 82))
  388.     {
  389.         gearflag = 1;
  390.         Call setcamstuff;
  391.         
  392.         //Place & lose gear...
  393.         PlayKey(tabindy, in_act_high, 2, 0x12, 0);
  394.         Sleep(0.4);
  395.         SetThingFlags(gear_assembly, 0x10); # inviso
  396.         ClearThingFlags(elev_gears, 0x80000);
  397.         SetInv(player, 82, 0);
  398.         PlaySoundThing(sophia_gear_place, elev_gears, 1, 5, 10, 0);
  399.         Sleep(0.5);
  400.  
  401.         //What know...Sophia's little gift has a purpose
  402.         PlayVoice(tabindy, in_giftpurpose, 1, 0);  # 3.4s
  403.  
  404.         # Zoom in...
  405.         SetCameraInterpSpeed(2, 2.5);
  406.         SetCameraSecondaryFocus(2, gear_targ1);
  407.         SetCameraFOV(40, 1, 2.5);
  408.         PlayKey(tabindy, in_SideToHips, 4, 0x12, 1); # 0.9s
  409.  
  410.         elev_track = PlayKey(elev_gears, elev_key, 4, 0x00, 0);
  411.         gear_track = PlaySoundThing(elev_gears_moving, elev_gears, 0.7, 1, 5, 1);
  412.  
  413.         PlayKey(tabindy, in_nod, 4, 0x12, 1); # 1.6s
  414.         PlayKey(tabindy, in_HipsToSide, 4, 0x12, 1); # 0.9s 
  415.         Sleep(0.1);
  416.  
  417.         SetCameraInterpSpeed(2, 2.0);
  418.         SetCameraSecondaryFocus(2, platform_tgt0);
  419.         SetCameraFOV(60, 1, 2.0);
  420.         MoveToFrame(platform, 2, 0.5);
  421.         WaitForStop(platform);
  422.         Sleep(1.0);
  423.         MoveToFrame(lowerButton, 0, 1);
  424.         MoveToFrame(upperButton, 0, 1);
  425.  
  426.         Call camfinish;
  427.  
  428.         DetachThing(block);
  429.         Sleep(1);
  430.         StopKey(elev_gears, elev_track, 0);
  431.         StopSound(gear_track, 0);
  432.         //PlaySoundThing(elev_gears_stop, elev_gears, 0.5, 5, 10, 0);
  433.     }
  434.     
  435.     //Tablet Check
  436.     if ((sender == tabletsocket) && (curitem == 0))
  437.     {
  438.         Call setcamstuff;
  439.         if (tabcheck == 0)
  440.         {
  441.             Call curiouslines;
  442.         }        
  443.         if ((tabcheck != 0) && (tabletflag == 0))
  444.         {
  445.             PlayVoice(tabindy, in_line_j01, 1.0, 1);
  446.         }
  447.         if ((tabcheck == 3) && (tabletflag != 0))
  448.         {
  449.             cursound = PlayVoice(tabindy, in_traveladvice, 1.0, 0);
  450.             Sleep(4.0);
  451.             PlayKey(tabindy, in_ltarmup, 4, 0x12, 1);
  452.             WaitForSound(cursound);
  453.         }
  454.         Call camfinish;
  455.     }
  456.  
  457.     if ((sender == tabletsocket) && (curitem != 0) && (curitem != 69) && (curitem != 70) && (curitem != 71))
  458.     {
  459.         SetActorFlags(player, 0x200000);
  460.         StartCutscene(0);
  461.         Call wrongitemlines;
  462.         EndCutscene();
  463.         ClearActorFlags(player, 0x200000);
  464.     }
  465.  
  466.     //Tablet A
  467.     if ((sender == tabletsocket) && (curitem == 69))
  468.     {
  469.         Call setcamstuff;
  470.         
  471.         tabcheck = tabcheck + 1;
  472.         PlayKey(tabindy, in_act_high, 4, 0x12, 0);
  473.         Sleep(0.5);
  474.         ChangeInv(player, 69, -1);
  475.         SetCollideType(CreateThing(babTabletA, tabletAPos), 0);
  476.         PlaySoundThing(placeItSound, tabletAPos, 1, 3, 10, 0);
  477.         if (tabcheck < 3)
  478.         {
  479.             Call tabtalkfinish;
  480.         }
  481.     }
  482.     
  483.     //Tablet B
  484.     if ((sender == tabletsocket) && (curitem == 70))
  485.     {
  486.         Call setcamstuff;
  487.  
  488.         tabcheck = tabcheck + 1;
  489.         PlayKey(tabindy, in_act_high, 4, 0x12, 0);
  490.         Sleep(0.5);
  491.         ChangeInv(player, 70, -1);
  492.         SetCollideType(CreateThing(babTabletB, tabletBPos), 0);
  493.         PlaySoundThing(placeItSound, tabletBPos, 1, 3, 10, 0);
  494.         if (tabcheck < 3)
  495.         {
  496.             Call tabtalkfinish;
  497.         } 
  498.     }
  499.     
  500.     //Tablet C
  501.     if ((sender == tabletsocket) && (curitem == 71))
  502.     {
  503.         Call setcamstuff;
  504.  
  505.         tabcheck = tabcheck + 1;
  506.         PlayKey(tabindy, in_act_high, 4, 0x12, 0);
  507.         Sleep(0.5);
  508.         ChangeInv(player, 71, -1);
  509.         SetCollideType(CreateThing(babTabletC, tabletCPos), 0);
  510.         PlaySoundThing(placeItSound, tabletAPos, 1, 3, 10, 0);
  511.         if (tabcheck < 3)
  512.         {
  513.             Call tabtalkfinish;
  514.         }     
  515.     }
  516.     
  517.     //When all tablets are placed continue here
  518.     if ((tabcheck == 3) && (tabletflag == 0))
  519.     {
  520.         tabletflag = 1;
  521.  
  522.         //Zoom in...
  523.         Sleep(0.5);
  524.         SetCameraFOV(80, 1, 1.0);
  525.  
  526.         in_track0 = PlayKey(tabindy, in_stand4, 2, 0x00, 0);
  527.         PlayKey(tabindy, in_SideToHips, 4, 0x12, 0);
  528.  
  529.         //Now it starts to make sense...(3.8s)
  530.         cursound = PlayVoice(tabindy, in_line_j03, 1, 0);
  531.  
  532.         //Dolly across...
  533.         SetCameraInterpSpeed(2, 35.0);
  534.         Sleep(1.0);
  535.         SetCameraFocus(2, tablet_cam1);
  536.         SetCameraFOV(60, 1, 35.0);
  537.  
  538.         WaitForSound(cursound);
  539.         Sleep(0.2);
  540.         in_track1 = PlayKey(tabindy, in_reading, 4, 0x12, 0);
  541.         Sleep(0.3);
  542.  
  543.         //Make welcome...great engine...(10sec)
  544.         cursound = PlayVoice(tabindy, in_line_j04, 1, 0);
  545.         Sleep(6.8); # was 6.8
  546.         StopKey(tabindy, in_track0, 0.5);
  547.         StopKey(tabindy, in_track1, 0.5);
  548.         Sleep(1.0);
  549.         in_track2 = PlayKey(tabindy, in_bothup, 4, 0x12, 0);
  550.         Sleep(1.5);
  551.         StopKey(tabindy, in_track2, 0.5);
  552.  
  553.         in_track0 = PlayKey(tabindy, in_stand4, 2, 0x00, 0);
  554.         PlayKey(tabindy, in_SideToHips, 4, 0x02, 0);
  555.     
  556.         WaitForSound(cursound);   
  557.         Sleep(0.8);
  558.  
  559.         PlayKey(tabindy, in_nod, 4, 0x12, 0);
  560.  
  561.         //Having no understanding...relics...(10sec)
  562.         cursound = PlayVoice(tabindy, in_line_j05, 1, 0);
  563.         Sleep(8.0);
  564.         in_track1 = PlayKey(tabindy, in_figithat, 4, 0x12, 0);
  565.         WaitForSound(cursound);
  566.         Sleep(0.8);
  567.         
  568.         doormusic = PlaySoundLocal(doorhappy, 0.5, 0, 0, 0);
  569.  
  570.         //Wouldst tread path...urgon...shambala...mighty secret...(10sec)
  571.         PlayVoice(tabindy, in_line_j06, 1, 0);
  572.         StopKey(tabindy, in_track0, 0.5);
  573.         StopKey(tabindy, in_track1, 0.5);
  574.         Sleep(4.0);
  575.         PlayKey(tabindy, in_rtarmup, 4, 0x12, 0);
  576.         Sleep(5.0);
  577.         
  578.         //rotate door
  579.         Rotate(roundmapdoor, 179, 1, 5);
  580.         door_chan=PlaySoundThing(rounddoor_spin, roundmapdoor, 1, 3, 10, 0);
  581.         Sleep(0.5);
  582.         AISetMoveSpeed(tabindy, 1.0);
  583.         SetThingMaxRotVel(tabindy, 120);
  584.         AISetLookThing(tabindy, tab_tgt1);
  585.         Sleep(0.5);
  586.  
  587.         SetCameraInterpSpeed(2, 3.5);
  588.         SetCameraSecondaryFocus(2, tab_tgt1);
  589.         SetCameraFOV(66, 1, 3.5);
  590.         WaitForStop(roundmapdoor);
  591.         door_stop=PlaySoundThing(rounddoor_stop, roundmapdoor, 1.0, 3, 10, 0);
  592.         
  593.         //move actor indy into shot
  594.         AISetMoveThing(tabindy, tab_door_mk, 1);
  595.         AIWaitForStop(tabindy);
  596.         AISetLookThing(tabindy, tab_tgt1);
  597.         
  598.         //hold for a second
  599.         Sleep(0.5);
  600.         
  601.         //Cut to side shot of Indy...
  602.         SetCameraPosInterp(2, 0);
  603.         SetCameraLookInterp(2, 0);
  604.         SetCameraInterpSpeed(2, 3);
  605.         Sleep(0.01);
  606.         SetCameraFocus(2, tablet_cam2);
  607.         SetCameraSecondaryFocus(2, tab_tgt3);
  608.         SetCurrentCamera(2);
  609.         SetCameraFOV(90, 0, 0); 
  610.         
  611.         //Heavenly Mountains...wonder...Tian Shan...
  612.         PlayKey(tabindy, in_scratch, 4, 0x12, 0);
  613.         PlayVoice(tabindy, in_line_j07, 1, 1);       //4sec
  614.         ChangeSoundVol(doormusic, 1, 1);
  615.  
  616.         //pan to tight shot of door
  617.         SetCameraLookInterp(2, 1);
  618.         Sleep(0.01);
  619.         SetCameraSecondaryFocus(2, tab_tgt2);
  620.         SetCameraFOV(80, 1, 2.0);
  621.         
  622.         //finish shot
  623.         Sleep(3);
  624.         SetCollideType(hiddendoor, 0);
  625.         MoveToFrame(hiddendoor, 1, 1);
  626.         WaitForStop(hiddendoor);
  627.         Sleep(1.0);
  628.         SetCollideType(hiddendoor, 3);
  629.         
  630.         Call camfinish;
  631.             
  632.         SendMessage(hintcog, user0);
  633.     }
  634.     
  635.     //handles lines for locked buttons
  636.     if ((sender == lowerButton) &&
  637.         (GetCurFrame(lowerButton) == 1) && 
  638.         (tabcheck != 3))
  639.     {
  640.         StopThing(player);
  641.         StartCutscene(1);
  642.         SetActorFlags(player, 0x200000);
  643.         PlayMode(player, 60, 0);
  644.         Sleep(0.5);
  645.         currand = RandBetween(0, 6);
  646.         While (lastrand == currand)
  647.         {
  648.             currand = RandBetween(0, 5);
  649.         }
  650.         PlayVoice(player, in_nowork0[currand], 1, 1);
  651.         lastrand = currand;
  652.         EndCutscene();
  653.         ClearActorFlags(player, 0x200000);
  654.     }
  655.     
  656.     //Send Indy up...
  657.     if ((sender == lowerButton) &&
  658.         (GetCurFrame(lowerButton) == 0) && 
  659.         (tabcheck == 3) && 
  660.         (blockon == 0))
  661.     {
  662.         MakeMeStop();
  663.         StartCutscene(1);
  664.         PlayMode(player, 60, 0);
  665.         Sleep(0.4);
  666.         
  667.         if (tabcamexists != 0)
  668.         {
  669.             DestroyThing(tabcam);
  670.         }
  671.         tabcamexists = 1;
  672.         v_campos =
  673.             VectorAdd(VectorTransformToOrient(platform, '0.15 0.01 0.27'), GetThingPos(platform));    
  674.         camsector = FindNewSectorFromThing(player, v_campos);
  675.         tabcam =
  676.             CreateThingAtPos(tpl_ghost, camsector, v_campos, '0 0 0');
  677.         CaptureThing(tabcam);
  678.         AttachThingToThing(tabcam, platform);
  679.         SetExtCamOffsetToThing(tabcam);
  680.         Sleep(0.2);
  681.  
  682.         MoveToFrame(lowerButton, 1, 1);
  683.         WaitForStop(lowerButton);
  684.         MoveToFrame(platform, 3, 3.5);
  685.         PlaySoundLocal(platformwav1, 1, 0, 0, 0);
  686.         in_track0 = PlayKey(player, in_lookup, 4, 0x00, 0);
  687.         WaitForStop(platform);
  688.         MoveToFrame(lowerButton, 0, 1);
  689.  
  690.         RestoreExtCam();
  691.         StopKey(player, in_track0, 0.5);
  692.         Sleep(0.5);
  693.         EndCutscene();
  694.         ClearActorFlags(player, 0x200000);
  695.     }   
  696.     
  697.     //send indy down
  698.     if ((sender == upperButton) && (GetCurFrame(upperButton) == 0) && (tabcheck == 3))
  699.     {
  700.         MakeMeStop();
  701.         StartCutscene(1);
  702.         PlayMode(player, 60, 0);
  703.         Sleep(0.4);
  704.  
  705.         if (tabcamexists != 0)
  706.         {
  707.             DestroyThing(tabcam);
  708.         }
  709.         tabcamexists = 1;
  710.         v_campos =
  711.             VectorAdd(VectorTransformToOrient(platform, '-0.15 0.02 0.1'), GetThingPos(platform));    
  712.         camsector = FindNewSectorFromThing(player, v_campos);
  713.         tabcam =
  714.             CreateThingAtPos(tpl_ghost, camsector, v_campos, '0 0 0');
  715.         CaptureThing(tabcam);
  716.         AttachThingToThing(tabcam, platform);
  717.         SetExtCamOffsetToThing(tabcam);
  718.         Sleep(0.2);
  719.  
  720.         MoveToFrame(upperButton, 1, 1);
  721.         WaitForStop(upperButton);
  722.         MoveToFrame(platform, 2, 3.5);
  723.         in_track0 = PlayKey(player, in_lookdn, 4, 0x00, 0);
  724.         WaitForStop(platform);
  725.         MoveToFrame(upperButton, 0, 1);
  726.  
  727.         RestoreExtCam();
  728.         StopKey(player, in_track0, 0.5);
  729.         Sleep(0.5);
  730.         EndCutscene();
  731.         ClearActorFlags(player, 0x200000);
  732.     }
  733.  
  734.     active = 0;   
  735.     return;
  736.  
  737. # ..............................................................................
  738.  
  739. setcamstuff:
  740.  
  741.     MakeMeStop();
  742.     StartCutscene(1); 
  743.  
  744.     # camera offset...
  745.     if (tabindyexists != 0)
  746.     {
  747.         DestroyThing(tabindy);
  748.     }
  749.     tabindy = CreateThing(tpl_indy, player);
  750.     CaptureThing(tabindy);
  751.     CopyPlayerHolsters(player, tabindy);
  752.     tabindyexists = 1;
  753.     Sleep(0.01);
  754.     ClearThingFlags(tabindy, 0x80000);
  755.     if ((sender == lowerbutton) || (sender == upperbutton))
  756.     {
  757.         SetThingFlags(player, 0x10);
  758.         return;
  759.     }
  760.     SetThingFlags(player, 0x80000);
  761.     viewangle = GetCameraFOV();
  762.     MakeCamera2LikeCamera1(cam1spot, cam1look);
  763.     SetCameraLookInterp(2, 0);
  764.     SetCameraPosInterp(2, 0);
  765.     SetCameraFocus(2, cam1spot);
  766.     SetCameraSecondaryFocus(2, cam1look);
  767.     SetCurrentCamera(2);
  768.     SetCameraFOV(viewangle, 0, 0.0);
  769.     SetCameraLookInterp(2, 1);
  770.     SetCameraPosInterp(2, 1);
  771.     SetCameraInterpSpeed(2, 0.8);
  772.     Sleep(0.01);
  773.     if (sender == gear_assembly)
  774.     {
  775.         SetCameraFocus(2, elev_cam0);
  776.         SetCameraSecondaryFocus(2, gear_targ0);
  777.         AISetLookThingEyeLevel(tabindy, gear_targ0);
  778.     }
  779.     if (sender == tabletsocket)
  780.     {
  781.         SetCameraFocus(2, tablet_cam0);
  782.         SetCameraSecondaryFocus(2, tab_tgt0);    
  783.         AISetLookThingEyeLevel(tabindy, tabletCPos);
  784.     }
  785.     if (sender == roundmapdoor)
  786.     {
  787.         SetCameraFocus(2, door_cam0);
  788.         SetCameraSecondaryFocus(2, tab_tgt3);    
  789.         AISetLookThingEyeLevel(tabindy, roundmapdoor);
  790.     }
  791.     AIWaitForStop(tabindy);
  792.  
  793.     return;
  794.  
  795. # ..............................................................................
  796.  
  797. camfinish:
  798.  
  799.     SetCameraLookInterp(2, 0);
  800.     SetCameraPosInterp(2, 0);
  801.     TeleportThing(player, tabindy);
  802.     SetThingFlags(tabindy, 0x80000);
  803.     ClearThingFlags(player, 0x80000);
  804.     if (sender == gear_assembly)
  805.     {
  806.         SetCameraPosition(1, GetThingPos(elev_cam0));
  807.     }
  808.     if (sender == tabletsocket)
  809.     {
  810.         if ((tabcheck != 3) || (tabletflag == 2))
  811.         {
  812.             SetCameraPosition(1, GetThingPos(tablet_cam0));
  813.         }
  814.         else
  815.         {        
  816.             SetCameraPosition(1, GetThingPos(tablet_cam2));
  817.             tabletflag = 2;
  818.         }
  819.     }
  820.     if (sender == roundmapdoor)
  821.     {
  822.         SetCameraPosition(1, GetThingPos(door_cam0));
  823.     }
  824.     Sleep(0.1);
  825.     SetCurrentCamera(1);
  826.     ResetCameraFOV(0, 0.0);
  827.     Sleep(0.3);
  828.     EndCutscene();
  829.     ClearActorFlags(player, 0x200000);      
  830.  
  831.     return;
  832.  
  833. # ..............................................................................
  834.  
  835. tabtalkfinish:
  836.  
  837.     if (tabcheck == 1)
  838.     {
  839.         PlayVoice(tabindy, in_line_j01, 1, 1);
  840.     }
  841.     if (tabcheck == 2)
  842.     {
  843.         PlayVoice(tabindy, in_line_j02, 1, 1);
  844.     }
  845.     SetCameraLookInterp(2, 0);
  846.     SetCameraPosInterp(2, 0);
  847.     TeleportThing(player, tabindy);
  848.     SetThingFlags(tabindy, 0x80000);
  849.     ClearThingFlags(player, 0x80000);
  850.     SetCameraPosition(1, GetThingPos(tablet_cam0));
  851.     Sleep(0.1);
  852.     SetCurrentCamera(1);
  853.     ResetCameraFOV(0, 0.0);
  854.     Sleep(0.3);
  855.     EndCutscene();
  856.     ClearActorFlags(player, 0x200000);
  857.  
  858.     return;
  859.  
  860. # ..............................................................................
  861.  
  862. budgelines:
  863.  
  864.     while (b_newline == b_oldline)
  865.     {        
  866.         b_newline = RandBetween(0, 4);
  867.     }
  868.     if (saidbudge == 0)
  869.     {
  870.         b_newline = 3;
  871.         saidbudge = 1;
  872.     }
  873.     b_oldline = b_newline;    
  874.  
  875.     cursound = PlayVoice(tabindy, in_cantopen[b_newline], 1.0, 0);
  876.     if ((b_newline == 3) || (b_newline == 4))
  877.     {
  878.         Sleep(0.5);
  879.         PlayKey(tabindy, in_ltarmup, 4, 0x12, 0);
  880.     }
  881.     WaitForSound(cursound);
  882.  
  883.     return;
  884.  
  885. # ..............................................................................
  886.  
  887. curiouslines:
  888.  
  889.     while (c_newline == c_oldline)
  890.     {        
  891.         c_newline = RandBetween(0, 4);
  892.     }
  893.     if ((sender == gear_assembly) && (saidgear == 0))
  894.     {
  895.         c_newline = 5;
  896.         saidgear = 1;
  897.     }
  898.     if ((sender == tabletsocket) && (saidtablet == 0))
  899.     {
  900.         c_newline = 4;
  901.         saidtablet = 1;
  902.     }
  903.     c_oldline = c_newline;
  904.  
  905.     PlayVoice(tabindy, in_interesting[c_newline], 1.0, 1);
  906.  
  907.     return;
  908.  
  909. # ..............................................................................
  910.  
  911. gadgetlines:
  912.  
  913.     while (g_newline == g_oldline)
  914.     {        
  915.         g_newline = RandBetween(0, 2);
  916.     }
  917.     if (saidgadget == 0)
  918.     {
  919.         g_newline = 0;
  920.         saidgadget = 1;
  921.     }
  922.     g_oldline = g_newline;    
  923.  
  924.     PlayVoice(tabindy, in_machinery[g_newline], 1.0, 1);
  925.  
  926.     return;
  927.  
  928. # ..............................................................................
  929.  
  930. wrongitemlines:
  931.  
  932.     while (w_newline == w_oldline)
  933.     {        
  934.         w_newline = RandBetween(0, 4);
  935.     }
  936.     if ((sender == gear_assembly) && (wronggear == 0))
  937.     {
  938.         w_newline = 3;
  939.         wronggear = 1;
  940.     }
  941.     if ((sender == tabletsocket) && (wrongtablet == 0))
  942.     {
  943.         w_newline = 4;
  944.         wrongtablet = 1;
  945.     }
  946.     w_oldline = w_newline;
  947.  
  948.     Sleep(0.3);
  949.     cursound = PlayVoice(player, in_wontwork[w_newline], 1.0, 0);
  950.     PlayKey(player, in_ltarmup, 4, 0x12, 0);
  951.     WaitForSound(cursound);
  952.  
  953.     return;
  954.  
  955. # ..............................................................................
  956.  
  957. blocked:
  958.  
  959.     if ((GetSenderRef() == platform) && (GetCurFrame(platform) == 2) && (GetSourceRef() == block) && (blockchek == 0))
  960.     {
  961.         MoveToFrame(platform, 1, 2);
  962.     }
  963.     return;
  964.  
  965. end
  966.  
  967.  
  968.  
  969.